import * as React from "react";
import Loadable from "react-loadable";

const loadable = (filename) => Loadable({
    loader:  () => import(`../pages/${filename}`),
    loading: () => ("")
});
// const Login = loadable("login/Login");
// const Register = loadable("register/Register");
const Index = loadable("index/Index");
// const UserLayout = loadable("layout/userLayout");

const routerArr = {
    "user": [
        // { path: "/user/login", exact: true, render: props => < Login {...props} /> },
        // { path: "/user/register", exact: true, render: props => < Register {...props} /> }
        // { path: '/user', component: loadable('login/Login') },
    ]
};

const routers = [
    {
        path:      "/",
        exact:     true,
        render: props => <Index {...props}/>
    },
    /*{
        path:      "/user",
        // exact: true,
        render: props => <UserLayout {...props}/>,
        routes:    routerArr.user
    }*/
];

export { loadable, routerArr };
export default routers;
